/* 
 * File:   matrix.h
 * Purpose:
 * Contains utiltiy procedures to manipulate 1-dimensional and 2-dimensional matrices
 * Author: abhi
 *
 * Created on September 18, 2011, 11:31 AM
 */

#ifndef MATRIX_H
#define	MATRIX_H
#include "rational.h"

#ifdef	__cplusplus
extern "C" {
#endif


    /* methods */

    /* Procedures for Integer Matrices */
    extern void getIntMatrix(int*** intMatrix, int rows, int cols);
    extern void getIntVector(int** intVector, int size);
    extern void copyIntMatrix(int*** sourceIntMatrix, int*** modifiedIntMatrix, int sourceStartRow, int sourceStartColumn, int modifiedStartRow, int modifiedStartColumn, int rowsToCopy, int colsToCopy);
    extern void copyIntVector(int** sourceIntVector, int** modifiedIntVector, int size);
    extern void convertIntToRationalVector(int** intVector, rational** rationalVector, int size);
    extern void resizeIntVector(int** intVector, int oldSize, int newSize);
    
    extern void printIntMatrix(int*** intMatrix, int rows, int cols);
    extern void printIntVector(int** intVector, int size);
    
    /* Procedures for Rational Matrices */
    extern void getRationalMatrix(rational*** rationalMatrix, int rows, int cols);
    extern void getRationalVector(rational** rationalVector, int size);
    extern void copyRationalVector(rational** sourceRationalVector, rational** modifiedRationalVector, int size);
    extern void convertIntToRationalMatrix(int*** intMatrix, rational*** rationalMatrix, int rows, int cols);
    extern void copyRationalMatrix(rational*** sourceRationalMatrix, rational*** modifiedRationalMatrix, int sourceStartRow, int sourceStartColumn, int modifiedStartRow, int modifiedStartColumn, int rowsToCopy, int colsToCopy);
    extern void resizeRationalVector(rational** rationalVector, int oldSize, int newSize);
    
    extern void getRationalScalarRationalVectorPdt(rational rationalScalar, rational** rationalVector, int size, rational** pdtRationalVector);
    
    extern void printRationalMatrix(rational*** rationalMatrix, int rows, int cols);
    extern void printRationalVector(rational** rationalVector, int size);
    
    
#ifdef	__cplusplus
}
#endif

#endif	/* MATRIX_H */

